﻿<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008">

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="../Brushes.xaml"/>
  </ResourceDictionary.MergedDictionaries>

  <Style x:Key="NuclearButtonFocusVisual">
  <Setter Property="Control.Template">
    <Setter.Value>
      <ControlTemplate>
        <Border>
          <Rectangle Margin="2" Stroke="#60000000" StrokeThickness="1" StrokeDashArray="1 2" />
        </Border>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

<Style TargetType="{x:Type Button}" BasedOn="{x:Null}">
  <Setter Property="FocusVisualStyle" Value="{DynamicResource NuclearButtonFocusVisual}" />
  <Setter Property="Background" Value="{DynamicResource NormalBrush}" />
  <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
  <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}" />
  <Setter Property="Template" Value="{DynamicResource ButtonTemplate}" />
  <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
</Style>

<ControlTemplate x:Key="ButtonTemplate" TargetType="{x:Type Button}">
  <ControlTemplate.Resources>
    <Storyboard x:Key="HoverOn">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="HoverShineBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="HoverBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>

    </Storyboard>
    <Storyboard x:Key="HoverOff">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="HoverShineBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="HoverBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value=".5" />
      </DoubleAnimationUsingKeyFrames>

    </Storyboard>
    <Storyboard x:Key="PressedOn">

      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>

    </Storyboard>
    <Storyboard x:Key="PressedOff">

      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>

    </Storyboard>
    <Storyboard x:Key="FocusedOn">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="FocussedOff">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>

  </ControlTemplate.Resources>
  <Grid x:Name="Grid">
    <Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" />
    <Border x:Name="HoverBorder" Opacity=".5" Background="{StaticResource HoverBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" />
    <Border x:Name="HoverShineBorder" Opacity="0" Background="{StaticResource HoverShineBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" />
    <Border x:Name="PressedBorder" Opacity="0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" Background="{StaticResource PressedBrush}" />
    <Border x:Name="ShineBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" Background="{StaticResource ShineBrush}" Opacity="1" />

    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                      Margin="{TemplateBinding Padding}"
                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                      RecognizesAccessKey="True" />

    <Border x:Name="FocusVisualElement" IsHitTestVisible="false" BorderBrush="{StaticResource KeyboardFocusBorderBrush}" BorderThickness="1" CornerRadius="3,3,3,3" Margin="1,1,1,1" Opacity="0" />
  </Grid>
  <ControlTemplate.Triggers>
    <Trigger Property="IsDefault" Value="True">
      <Setter Property="BorderBrush" TargetName="ShineBorder" Value="{DynamicResource DefaultedBorderBrush}" />
    </Trigger>
    <Trigger Property="IsKeyboardFocused" Value="true">
      <Trigger.ExitActions>
        <BeginStoryboard Storyboard="{StaticResource FocussedOff}" x:Name="FocussedOff_BeginStoryboard" />
      </Trigger.ExitActions>
      <Trigger.EnterActions>
        <BeginStoryboard Storyboard="{StaticResource FocusedOn}" x:Name="FocusedOn_BeginStoryboard" />
      </Trigger.EnterActions>

    </Trigger>
    <Trigger Property="IsMouseOver" Value="true">
      <Trigger.ExitActions>
        <BeginStoryboard Storyboard="{StaticResource HoverOff}" x:Name="HoverOff_BeginStoryboard" />
      </Trigger.ExitActions>
      <Trigger.EnterActions>
        <BeginStoryboard Storyboard="{StaticResource HoverOn}" />
      </Trigger.EnterActions>

    </Trigger>
    <Trigger Property="IsPressed" Value="true">
      <Trigger.ExitActions>
        <BeginStoryboard Storyboard="{StaticResource PressedOff}" />
      </Trigger.ExitActions>
      <Trigger.EnterActions>
        <BeginStoryboard Storyboard="{StaticResource PressedOn}" />
      </Trigger.EnterActions>
    </Trigger>
    <Trigger Property="IsEnabled" Value="true" />
    <Trigger Property="IsEnabled" Value="false">
      <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Background" />
      <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="ShineBorder" />
      <Setter Property="Opacity" TargetName="Grid" Value="0.5" />
    </Trigger>
  </ControlTemplate.Triggers>
</ControlTemplate>

<Style x:Key="RadioButtonFocusVisual">
  <Setter Property="Control.Template">
    <Setter.Value>
      <ControlTemplate>
        <Border>
          <Rectangle Margin="15,0,0,0" Stroke="#60000000" StrokeThickness="1" StrokeDashArray="1 2" />
        </Border>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

<Style x:Key="CheckBoxFocusVisual">
  <Setter Property="Control.Template">
    <Setter.Value>
      <ControlTemplate>
        <Border>
          <Rectangle Margin="15,0,0,0" Stroke="#60000000" StrokeThickness="1" StrokeDashArray="1 2" />
        </Border>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

<Style TargetType="{x:Type CheckBox}">
  <Setter Property="SnapsToDevicePixels" Value="true" />
  <Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}" />
  <Setter Property="Background" Value="{DynamicResource NormalBrush}" />
  <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
  <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}" />
  <Setter Property="Template" Value="{DynamicResource CheckBoxTemplate}" />
</Style>

<ControlTemplate x:Key="CheckBoxTemplate" TargetType="{x:Type CheckBox}">
  <ControlTemplate.Resources>
    <Storyboard x:Key="HoverOn">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="HoverOff">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="PressedOn">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PressedRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="PressedOff">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PressedRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="CheckedTrue">
      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="CheckedFalse">
      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="IndeterminateOn">
      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="IndeterminateOff">
      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="FocussedOn">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentFocusVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="FocussedOff">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentFocusVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
  </ControlTemplate.Resources>
  <BulletDecorator Background="Transparent" x:Name="bulletDecorator">
    <BulletDecorator.Bullet>
      <Grid Width="16" Height="16">
        <Rectangle Height="14" Margin="1" x:Name="Background" Width="14" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" />
        <Rectangle Height="14" Margin="1" x:Name="BackgroundOverlay" Width="14" Opacity="0" Fill="{x:Null}" Stroke="{StaticResource HoverBrush}" StrokeThickness="2" />
        <Rectangle Height="16" x:Name="PressedRectangle" Width="16" IsHitTestVisible="false" Opacity="0" Stroke="{StaticResource HoverBrush}" StrokeThickness="1" />
        <Path Height="10" Margin="1,1,0,1.5" x:Name="CheckIcon" Width="10.5" Opacity="0" Fill="{StaticResource GlyphBrush}" Stretch="Fill" Data="M102.03442,598.79645 L105.22962,597.78918 L106.78825,600.42358 C106.78825,600.42358 108.51028,595.74304 110.21724,593.60419 C112.00967,591.35822 114.89314,591.42316 114.89314,591.42316 C114.89314,591.42316 112.67844,593.42645 111.93174,594.44464 C110.7449,596.06293 107.15683,604.13837 107.15683,604.13837 z" />
        <Rectangle Height="8" x:Name="IndeterminateIcon" Width="10" Opacity="0" Fill="{StaticResource GlyphBrush}" />
        <Rectangle Height="14" x:Name="DisabledVisualElement" Width="14" Opacity="0" Fill="{StaticResource DisabledBackgroundBrush}" />
        <Rectangle Height="16" x:Name="ContentFocusVisualElement" Width="16" IsHitTestVisible="false" Opacity="0" Stroke="{StaticResource HoverShineBrush}" StrokeThickness="1" />
        <Rectangle Height="12" x:Name="ShineRectangle" Width="14" IsHitTestVisible="false" Opacity="1" Stroke="{x:Null}" StrokeThickness="1" Fill="{StaticResource ShineBrush}" Margin="2,2,2,2" />
      </Grid>
    </BulletDecorator.Bullet>
    <ContentPresenter RecognizesAccessKey="True" Margin="5,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" />
  </BulletDecorator>
  <ControlTemplate.Triggers>
    <Trigger Property="IsFocused" Value="True">
      <Trigger.ExitActions>
        <BeginStoryboard Storyboard="{StaticResource FocussedOff}" x:Name="FocussedOff_BeginStoryboard" />
      </Trigger.ExitActions>
      <Trigger.EnterActions>
        <BeginStoryboard Storyboard="{StaticResource FocussedOn}" x:Name="FocussedOn_BeginStoryboard" />
      </Trigger.EnterActions>
    </Trigger>
    <MultiTrigger>
      <MultiTrigger.Conditions>
        <Condition Property="IsChecked" Value="True" />
        <Condition Property="IsThreeState" Value="True" />
      </MultiTrigger.Conditions>
      <MultiTrigger.EnterActions>
        <BeginStoryboard x:Name="ThreeStateOn_BeginStoryboard" Storyboard="{StaticResource CheckedFalse}" />
      </MultiTrigger.EnterActions>
      <MultiTrigger.ExitActions>
        <BeginStoryboard x:Name="ThreeStateOff_BeginStoryboard" Storyboard="{StaticResource CheckedTrue}" />
      </MultiTrigger.ExitActions>
    </MultiTrigger>
    <MultiTrigger>
      <MultiTrigger.Conditions>
        <Condition Property="IsChecked" Value="{x:Null}" />
        <Condition Property="IsThreeState" Value="True" />
      </MultiTrigger.Conditions>
      <MultiTrigger.EnterActions>
        <BeginStoryboard x:Name="ThreeStateOn1_BeginStoryboard" Storyboard="{StaticResource IndeterminateOn}" />
      </MultiTrigger.EnterActions>
      <MultiTrigger.ExitActions>
        <BeginStoryboard x:Name="ThreeStateOff1_BeginStoryboard" Storyboard="{StaticResource IndeterminateOff}" />
      </MultiTrigger.ExitActions>
      <Setter Property="Visibility" TargetName="CheckIcon" Value="Hidden" />
    </MultiTrigger>
    <Trigger Property="IsChecked" Value="True">
      <Trigger.ExitActions>
        <BeginStoryboard Storyboard="{StaticResource CheckedFalse}" x:Name="CheckedTrue_BeginStoryboard" />
      </Trigger.ExitActions>
      <Trigger.EnterActions>
        <BeginStoryboard x:Name="CheckedTrue_BeginStoryboard1" Storyboard="{StaticResource CheckedTrue}" />
      </Trigger.EnterActions>
    </Trigger>
    <Trigger Property="IsMouseOver" Value="true">
      <Trigger.EnterActions>
        <BeginStoryboard Storyboard="{StaticResource HoverOn}" />
      </Trigger.EnterActions>
      <Trigger.ExitActions>
        <BeginStoryboard Storyboard="{StaticResource HoverOff}" />
      </Trigger.ExitActions>
    </Trigger>
    <Trigger Property="IsEnabled" Value="false">
      <Setter Property="Fill" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Background" />
      <Setter Property="Stroke" Value="{DynamicResource DisabledBorderBrush}" TargetName="Background" />
      <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}" />
      <Setter Property="Opacity" TargetName="bulletDecorator" Value="0.5" />
    </Trigger>
  </ControlTemplate.Triggers>
</ControlTemplate>

<Style TargetType="{x:Type RadioButton}">
  <Setter Property="SnapsToDevicePixels" Value="true" />
  <Setter Property="FocusVisualStyle" Value="{DynamicResource RadioButtonFocusVisual}" />
  <Setter Property="Background" Value="{DynamicResource NormalBrush}" />
  <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
  <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}" />
  <Setter Property="Template" Value="{DynamicResource RadioButtonTemplate}" />
  <Style.Triggers>
  </Style.Triggers>
</Style>

<ControlTemplate x:Key="RadioButtonTemplate" TargetType="{x:Type RadioButton}">
  <ControlTemplate.Resources>
    <Storyboard x:Key="HoverOn">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="HoverOff">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="PressedOn">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PressedEllipse" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="PressedOff">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PressedEllipse" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="CheckedOn">
      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="CheckedOff">
      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="FocussedOn">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentFocusVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="FocussedOff">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentFocusVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
  </ControlTemplate.Resources>
  <BulletDecorator Background="Transparent" x:Name="bulletDecorator">
    <BulletDecorator.Bullet>
      <Grid Width="16" Height="16">
        <Ellipse Height="14" Margin="1" x:Name="Background" Width="14" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" />
        <Ellipse Height="14" Margin="1" x:Name="BackgroundOverlay" Width="14" StrokeThickness="2" Stroke="{StaticResource HoverBrush}" Opacity="0" />
        <Ellipse Height="14" Margin="1" x:Name="PressedEllipse" Width="14" StrokeThickness="{TemplateBinding BorderThickness}" Stroke="{StaticResource HoverBrush}" Opacity="0" />
        <Ellipse Height="6" x:Name="CheckIcon" Width="6" Opacity="0" Fill="{StaticResource GlyphBrush}" />
        <Ellipse Height="14" x:Name="DisabledVisualElement" Width="14" Opacity="0" Fill="{StaticResource DisabledBackgroundBrush}" />
        <Ellipse Height="16" x:Name="ContentFocusVisualElement" Width="16" IsHitTestVisible="false" Opacity="0" Stroke="{StaticResource HoverShineBrush}" StrokeThickness="1" />
        <Ellipse Height="12" Margin="2,2,2,2" x:Name="ShineEllipse" Width="12" StrokeThickness="{TemplateBinding BorderThickness}" Stroke="{x:Null}" Fill="{StaticResource ShineBrush}" />
      </Grid>
    </BulletDecorator.Bullet>
    <ContentPresenter RecognizesAccessKey="True" Margin="5,0,0,0" />
  </BulletDecorator>
  <ControlTemplate.Triggers>
    <Trigger Property="IsFocused" Value="True">
      <Trigger.ExitActions>
        <BeginStoryboard Storyboard="{StaticResource FocussedOff}" x:Name="FocussedOff_BeginStoryboard" />
      </Trigger.ExitActions>
      <Trigger.EnterActions>
        <BeginStoryboard Storyboard="{StaticResource FocussedOn}" x:Name="FocussedOn_BeginStoryboard" />
      </Trigger.EnterActions>
    </Trigger>
    <!-- BugFix: Radio Button did not display initial checked value
     http://wpf.codeplex.com/discussions/58152?ProjectName=wpf -->
    <Trigger Property="IsChecked" Value="true">
      <Trigger.EnterActions>
        <BeginStoryboard Storyboard="{StaticResource CheckedOn}" x:Name="CheckedOn_BeginStoryboard"/>
      </Trigger.EnterActions>
      <Trigger.ExitActions>
        <BeginStoryboard Storyboard="{StaticResource CheckedOff}" x:Name="CheckedOff_BeginStoryboard"/>
      </Trigger.ExitActions>
    </Trigger>
    <!--
      <Trigger Property="IsChecked" Value="false">
        <Trigger.ExitActions>
          <BeginStoryboard x:Name="CheckedOn_BeginStoryboard" Storyboard="{StaticResource CheckedOn}" />
        </Trigger.ExitActions>
        <Trigger.EnterActions>
          <BeginStoryboard x:Name="CheckedOff_BeginStoryboard" Storyboard="{StaticResource CheckedOff}" />
        </Trigger.EnterActions>
      </Trigger>
BugFix: Radio Button did not display initial checked value -->
    <Trigger Property="IsChecked" Value="True" />
    <Trigger Property="IsMouseOver" Value="true">

      <Trigger.ExitActions>
        <BeginStoryboard x:Name="HoverOff_BeginStoryboard" Storyboard="{StaticResource HoverOff}" />
      </Trigger.ExitActions>
      <Trigger.EnterActions>
        <BeginStoryboard Storyboard="{StaticResource HoverOn}" />
      </Trigger.EnterActions>

    </Trigger>
    <Trigger Property="IsPressed" Value="true">

      <Trigger.ExitActions>
        <BeginStoryboard x:Name="PressedOff_BeginStoryboard" Storyboard="{StaticResource PressedOff}" />
      </Trigger.ExitActions>
      <Trigger.EnterActions>
        <BeginStoryboard x:Name="PressedOn_BeginStoryboard" Storyboard="{StaticResource PressedOn}" />
      </Trigger.EnterActions>

    </Trigger>
    <Trigger Property="IsEnabled" Value="false">
      <Setter Property="Fill" TargetName="Background" Value="{DynamicResource DisabledBackgroundBrush}" />
      <Setter Property="Stroke" TargetName="Background" Value="{DynamicResource DisabledBorderBrush}" />
      <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}" />
      <Setter Property="Opacity" TargetName="bulletDecorator" Value="0.5" />
    </Trigger>
  </ControlTemplate.Triggers>
</ControlTemplate>

<Style d:IsControlPart="True" TargetType="{x:Type RepeatButton}" BasedOn="{x:Null}">
  <Setter Property="Background" Value="{DynamicResource NormalBrush}" />
  <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}" />
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type RepeatButton}">
        <ControlTemplate.Resources>
          <Storyboard x:Key="HoverOn">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
              <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0.8"/>
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
          <Storyboard x:Key="HoverOff">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
              <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.3"/>
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
          <Storyboard x:Key="PressedOn">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
              <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0.1"/>
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
          <Storyboard x:Key="PressedOff">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
              <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.3"/>
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
        </ControlTemplate.Resources>
        <Grid>
          <Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" Opacity="1" />
          <ContentPresenter HorizontalAlignment="Center" x:Name="ContentPresenter" VerticalAlignment="Center" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" Opacity="0.3" Height="Auto" />
        </Grid>
        <ControlTemplate.Triggers>
          <Trigger Property="IsKeyboardFocused" Value="true" />
          <Trigger Property="IsMouseOver" Value="true">
            <Trigger.ExitActions>
              <BeginStoryboard Storyboard="{StaticResource HoverOff}" x:Name="HoverOff_BeginStoryboard"/>
            </Trigger.ExitActions>
            <Trigger.EnterActions>
              <BeginStoryboard Storyboard="{StaticResource HoverOn}"/>
            </Trigger.EnterActions>
          </Trigger>
          <Trigger Property="IsPressed" Value="true">
            <Trigger.ExitActions>
              <BeginStoryboard Storyboard="{StaticResource PressedOff}" x:Name="PressedOff_BeginStoryboard"/>
            </Trigger.ExitActions>
            <Trigger.EnterActions>
              <BeginStoryboard Storyboard="{StaticResource PressedOn}" x:Name="PressedOn_BeginStoryboard"/>
            </Trigger.EnterActions>
          </Trigger>
          <Trigger Property="IsEnabled" Value="false">
            <Setter Property="Opacity" TargetName="ContentPresenter" Value="0.1"/>
          </Trigger>
        </ControlTemplate.Triggers>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

<Style x:Key="NuclearThumbStyle" d:IsControlPart="True" TargetType="{x:Type Thumb}" BasedOn="{x:Null}">
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type Thumb}">
        <ControlTemplate.Resources>
          <Storyboard x:Key="HoverOn">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="HoverRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
              <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0.8"/>
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
          <Storyboard x:Key="HoverOff">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="HoverRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
              <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.3"/>
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
          <Storyboard x:Key="PressedOn">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PressedRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
              <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0.1"/>
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
          <Storyboard x:Key="PressedOff">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PressedRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
              <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.3"/>
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
        </ControlTemplate.Resources>
        <Grid Margin="0,0,0,0" x:Name="Grid">
          <Rectangle HorizontalAlignment="Stretch" x:Name="HoverRectangle" VerticalAlignment="Stretch" Width="Auto" Height="Auto" RadiusX="3" RadiusY="4" Stroke="{x:Null}" Margin="4.5,-2,4.5,-2" Opacity="0.3" MinHeight="10">
            <Rectangle.Fill>
              <SolidColorBrush Color="{DynamicResource WhiteColor}" />
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle HorizontalAlignment="Stretch" x:Name="PressedRectangle" VerticalAlignment="Stretch" Width="Auto" Height="Auto" RadiusX="3" RadiusY="4" Stroke="{x:Null}" Margin="4.5,-2,4.5,-2" Opacity="0.3" MinHeight="10">
            <Rectangle.Fill>
              <SolidColorBrush Color="{DynamicResource WhiteColor}" />
            </Rectangle.Fill>
          </Rectangle>
        </Grid>
        <ControlTemplate.Triggers>
          <Trigger Property="IsFocused" Value="True" />
          <Trigger Property="IsMouseOver" Value="True">
            <Trigger.ExitActions>
              <BeginStoryboard Storyboard="{StaticResource HoverOff}" x:Name="HoverOff_BeginStoryboard"/>
            </Trigger.ExitActions>
            <Trigger.EnterActions>
              <BeginStoryboard Storyboard="{StaticResource HoverOn}"/>
            </Trigger.EnterActions>
          </Trigger>
          <Trigger Property="IsEnabled" Value="False" >
            <Setter Property="Opacity" TargetName="Grid" Value="0.1"/>
          </Trigger>
          <Trigger Property="IsDragging" Value="True">
            <Trigger.ExitActions>
              <BeginStoryboard Storyboard="{StaticResource PressedOff}" x:Name="PressedOff_BeginStoryboard"/>
            </Trigger.ExitActions>
            <Trigger.EnterActions>
              <BeginStoryboard Storyboard="{StaticResource PressedOn}" x:Name="PressedOn_BeginStoryboard"/>
            </Trigger.EnterActions>
          </Trigger>
        </ControlTemplate.Triggers>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

<Style x:Key="NuclearScrollRepeatButtonStyle" d:IsControlPart="True" TargetType="{x:Type RepeatButton}">
  <Setter Property="Background" Value="Transparent" />
  <Setter Property="BorderBrush" Value="Transparent" />
  <Setter Property="IsTabStop" Value="false" />
  <Setter Property="Focusable" Value="false" />
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type RepeatButton}">
        <Grid>
          <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" />
        </Grid>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

</ResourceDictionary>
